Hybrid Activity Week 7

Practice multiple choice questions for Midterm I

Question 1
Which pairing of words best represents a correspondence in the context of Java Persistence?
	Class : Column	
	Column : Entity
	Entity : Field
	Table : Instance	
	Object : Row (correct)

Question 2
Which of the following statements is true?
	A Java thread that issues a wait() call enters the Blocked state
	All three of these answers (correct)
	None of these three answers
	A Java thread that has nothing to do might issue a wait() call
	A Java thread that has nothing to do might issue a notifyAll() call

Question 3
Which of the following statements is true?
	None of these three answers
	All three of these answers
	UDP should not be used for Video Applications
	UDP stands for Unreliable Datablock Protocol
	UDP is designed for speed, not reliability (correct)

Question 4	
Regarding TCP/IP, a difference between UDP and TCP is that
	None of these three answers
	TCP and UDP both establish connections, but only TCP is reliable
	UDP packets might need to be explicitly resent by the application if they are lost (correct)
	UDP involves IP packets, whereas TCP does not
	All three of these answers

Question 5
Object-Relational Mapping (ORM) deals with
	matching each attribute of an object to its corresponding row in a database table
	mapping objects in OOP to relational entities in a database (correct)
	matching stubs of objects on a client to remote objects on a server
	mapping methods of client objects to remote stubs on a server

Question 6
Which of the following is not a valid, possibly partial, state sequence for a Java thread?
	Running -> Blocked -> Runnable -> Sleeping (correct)
	All three of these answers
	Runnable -> Running -> Blocked -> Runnable
	None of these three answers
	Runnable -> Running-> Sleeping -> Runnable

Question 7
In the context of Enterprise Programming, Hibernate is
	a Java extension of mysql
	a persistence framework for Java (correct)
	an RDBMS for Java
	a Java implementation of SQL
	an implementation of JDBC for Java RMI programs

Question 8
Which pairing of words best represents a correspondence in the context of Java Persistence?
	Class : Column
	Object : Class
	Column : Entity
	Table : Instance
	Attribute : Column (correct)

Question 9
JDBC is
	an SQL extension for Java
	an implementation of SQL in Java
	an API for Java programs to communicate with databases (correct)
	an implementation of mysql in Java
	an acronym for Java Database Byte Code

Question 10	
Which pairing of words best represents a correspondence in the context of Java Persistence?
	Entity : Table (correct)
	Class : Column
	Attribute : Row
	Table : Instance
	Column : Entity

Question 11
To implement an RMI client application, the following method call is necessary to bind to an RMI service:
	Naming.rebind	
	UnicastRemoteObject.exportObject	
	LocateRegistry.createRegistry
	None of these three answers (correct)
	All three of these answers

Question 12	
To implement an RMI server application, the following method call is necessary to make a certain service available on a certain port:
	All three of these answers	
	None of these three answers
	Naming.lookup
	LocateRegistry.createRegistry
	Naming.rebind (correct)
	
Question 13	
Which of the following statements is true about a remote object in a Java RMI implementation
	It must extend the java.rmi.server.UnicastRemoteObject class	
	All three of these answers	
	It must declare a java.rmi.RemoteException in its constructor (correct)	
	None of these three answers	
	Its methods may only take primitive data types as arguments

Question 14
Which of the following statements is true?
	All three of these answers (correct)
	The Java code for creating an ExecutorService could be ExecutorService executor = Executors.newCachedThreadPool();
	The Executor interface helps manage the execution of Runnable objects.	
	The Executors class has a method newCachedThreadPool that returns an ExecutorService
	None of these three answers

Question 15
Which of the following statements about Java networking is true?
	A Client needs to listen on a well known port number
	None of these answers
	A Server needs to listen on a port number that is known to the client (correct)
	A Server initiates a connection to a Client on a well-known port
	All of these answers

Question 16
Which of the following is a valid, possibly partial, state sequence for a Java thread?
	Blocked -> Running -> Sleeping -> Dead	
	None of these three answers
	Runnable -> Blocked -> Running -> Dead
	All three of these answers
	Sleeping-> Runnable -> Running -> Dead (correct)

Question 17	
The Java code block public synchronized void doIt() {<statements>} would mean
	Only one thread at a time can run <statements>
	Only one thread at a time can run the object's doIt() method (correct)
	None of these three answers
	Only one thread at a time can run the doIt() method
	All three of these answers

Question 18
Which of the following statements about Java multithreading is false?
	None of these three answers	
	Each thread has a priority	
	A Sleeping thread may enter the Runnable state due to an Interrupt	
	All threads of equal priority run simultaneously (correct)
	All three of these answers

Question 19
Which of the following statements is true?
	suspend(), resume(), and stop() are recommended for proper thread management
	notify(), notifyAll(), and wait() are never called in synchronized code
	notify(), notifyAll(), and wait() should be called only in synchronized code (correct)
	All three of these answers
	None of these three answers

Question 20
The role of Hibernate in a Java application with persistence is an
	alternative for SQL
	intermediary between Java and JDBC (correct)
	intermediary between JDBC and an RDBMS
	alternative for an RDBMS
	alternative for JDBC

Question 21
A Java RMI remote object may use the UnicastRemoteObject.exportObject() method to be linked into RMI
	False
	True (correct)

Question 22
Which of the following statements is true about Java multi-threading?
	None of these three answers
	It is important to take into account whether the base platform supports time-slicing.
	Java's multi-threading implementation is platform dependent
	All three of these answers (correct)
	The Microsoft Windows platform supports time-slicing

Question 23
Which of the following statements is true about Java Remote Method Invocation (RMI):
	It provides the ability to download the definition of an object's class when the class is not defined in the Java Virtual machine	
	None of these three answers
	The types and behaviors of an object can be transmitted to another Java Virtual Machine	
	New types and behaviors can be introduced into a remote Java Virtual Machine	
	All three of these answers (correct)

Question 24
The Java code block synchronized(someObject){<statements>} would mean
	All three of these answers
	Any thread executing <statements> will wait() for a notify() if it accesses someObject
	None of these three answers
	Any thread executing <statements> must have registered its own monitor lock
	Any thread executing <statements> must have acquired the monitor lock on someObject (correct)

Question 25
In the context of Java Objects, Serialization
	Is involved in sending objects across a network
	None of these three answers
	Is possible for Java objects that implement the Serializable interface
	Is necessary for Remote Method Invocation to pass Object parameters
	All three of these answers (correct)

Question 26
Which of the following statements is true about Java multi-threading?
	Java's automatic garbage collection is an example of a daemon thread. (correct)
	None of these three answers
	All threads in Java run at the same priority.
	Java's automatic garbage collection is an example of a high-priority thread.
	All three of these answers